package com.example.project.webControlleer;

import com.example.project.dao.UserDAO;
import com.example.project.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("web")
public class WebWalletController {
    @RequestMapping("wallet")
    public  void wallet(HttpSession session, HttpServletRequest request) {
        UserDAO userDAO=new UserDAO();
        User user =(User) session.getAttribute("user");
       double money= userDAO.findTotalMoneyByID(user.getId());
       request.setAttribute("money",money);
    }

}
